package com.itheima.d1_properties;

import java.io.FileReader;
import java.io.FileWriter;
import java.util.Properties;

public class demo03 {
    public static void main(String[] args) throws Exception {
        Properties properties = new Properties();
        properties.load(new FileReader("user2.properties"));
        System.out.println(properties);

        if(properties.containsKey("妲己")){
            properties.setProperty("妲己","爱心");
        }
        System.out.println(properties);

        properties.store(new FileWriter("user2.properties"),
                "瞎写");


    }
}
